package com.teufandsub.socialproximity.gui;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.teufandsub.socialproximity.R;
import com.teufandsub.socialproximity.logic.User;

/**
 * @author Bastien Mathias <bastienmathias@gmail.com>
 * @author Antoine Teuf <antoine.teuf@gmail.com>
 * @version 1.0
 * @since 2013-05-22
 * 
 * Class to display information about a user.
 */

public class UserDetailsActivity extends SocialProxActivity implements OnClickListener {

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		User friend = (User) getIntent().getSerializableExtra(User.KIND);
		
		setContentView(R.layout.activity_user_details_display_name);
		
		TextView name = (TextView) findViewById(R.id.name_tv);
		name.setText(getResources().getString(R.string.name)+" : "+friend.getFirstname() + " " + friend.getSurname());
		
		TextView username = (TextView) findViewById(R.id.username_tv);
		username.setText(getResources().getString(R.string.username) + " : " + friend.getUsername());
		
		TextView email = (TextView) findViewById(R.id.email_tv);
		email.setText(getResources().getString(R.string.email) +" : " + friend.getEmail());
		
		TextView sex = (TextView) findViewById(R.id.sex_tv);
		switch(friend.getSex()){
			case User.SEX_MALE: sex.setText(getResources().getString(R.string.gender_man));break;
			case User.SEX_FEMALE: sex.setText(getResources().getString(R.string.gender_woman));break;
			case User.SEX_UNKNOWN : sex.setText(getResources().getString(R.string.gender_unknown));break;
		}

	}
	
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}
}
